import request from '../../utils/request.js'
export default {
	state:{
		//首页初始化数据
		initData:{}
	},
	actions:{
		async getIndexData({commit}){
			const result = await request('/getIndexData')
			if(result.code === 200){
				commit('receive_init_data',result.indexData)
			}
		}
	},
	mutations:{
		receive_init_data(state,initData){
			state.initData = initData
		}
	},
	getters:{
		kingKongList(state) {
			return state.initData.kingKongModule ? state.initData.kingKongModule.kingKongList : []
		}
	}
}